import React, { Component } from 'react'
import DataHoc from "../template/data-hoc";
import AdvancedTable from "components/advanced-table";
import { messages } from "share/common";
import httpFetch from "share/httpFetch";

@DataHoc
class PayCancel extends Component {

  key = 'pay_cancel';

  service = (page, size, searchParams) => {
    return httpFetch.post('/api/v2/expense/reports/finance/admin/search', { page, size, ...searchParams, status: this.key })
  };

  render() {
    const { getColumns, getSearchForm, renderAllExpandedRow, handleRowClick } = this.props;
    return(
      <div style={{ height: '100%' }}>
        <AdvancedTable
          title={messages('finance-4.key315')/*支付取消*/}
          tableName='pay_cancel'
          service={this.service}
          searchForm={getSearchForm(this.key, 'EXP_REPORT')}
          rowKey="id"
          onRef={ref => this.advancedTableRef = ref}
          index
          onRow={ record => ({ onClick: () => handleRowClick(record, 'EXP_REPORT') })}
          columns={getColumns(this.key)}
          expandedRowRender={renderAllExpandedRow}
        />
      </div>
    )
  }

}

export default PayCancel
